using Common.Commands;
using Common.Commands.FolderCommands;
using Core.Domain.Model;
using Sanelib.DataOperation;
using Sanelib.Dto;

namespace Core.Processors.FolderProcessors
{
	public class DeleteFolderProcessor : ICommandProcessor<DeleteFolder>
	{
		private readonly IRepository<Folder> _repository;

		public DeleteFolderProcessor(IRepository<Folder> repository)
		{
			_repository = repository;
		}

		public dynamic Process(DeleteFolder command)
 		{
			var response = new WebApiResultResponse();

			var clientcase = _repository.GetById(command.Id);

			_repository.Delete(clientcase.Id);

			response.IsSuccess = true;

			return response;
		}
	}
}
